from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    # 点击搜索
    def shoushuo(self):
        loc = (By.XPATH, '//android.widget.TextView[@text="搜商品名称 作者 出版社 ISBN"]')
        ele = self.find_ele(loc)
        return ele
    # 输入文字
    def shuru(self):
        loc = (By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele
    # 点击搜索按钮
    def anniou(self):
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().resourceId("com.kongfz.app:id/tvSearch")')
        ele = self.find_ele(loc)
        return ele
    # 点击购物车按钮
    def gouwuche(self):
        loc = (By.XPATH, '(//android.widget.TextView[@text=""])[1]')
        ele = self.find_ele(loc)
        return ele
    #点击进入购物车按钮
    def jinrugouwuche(self):
        loc = (By.ANDROID_UIAUTOMATOR , 'new UiSelector().text("").instance(2)')
        ele = self.find_ele(loc)
        return ele
    # 点击选项框
    def xuanxkuang(self):
        loc = (By.ID, 'com.kongfz.app:id/icon_font_choice_all')
        ele = self.find_ele(loc)
        return ele
    #点击去购买
    def goumai(self):
        loc = (By.ID, 'com.kongfz.app:id/icon_font_choice_all')
        ele = self.find_ele(loc)
        return ele